import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:my_test_demo/routers/Routes.dart';
import 'package:my_test_demo/util/sp_util.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await SpUtil.init();
  runApp(MyApp());
  SystemChrome.setSystemUIOverlayStyle(
    SystemUiOverlayStyle(
      systemNavigationBarColor: Color(0xffffffff),
      systemNavigationBarIconBrightness: Brightness.dark,
      statusBarColor: Color(0x333333),
      statusBarIconBrightness: Brightness.light,
      statusBarBrightness: Brightness.light,
    ),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "HRL微博",
      debugShowCheckedModeBanner: false,
      theme: ThemeData(primaryColor: Colors.white),
      initialRoute: '/splash',
      //初始化的时候加载的路由
      onGenerateRoute: onGenerateRoute,
    );
  }
}
